﻿using UnityEngine;
using System.Collections.Generic;
using ProtoBuf.Message;

namespace UI
{
    public class UIUnionFightAwardItem : MonoBehaviour
    {
        public UILabel contribution;
        public UILabel horner;
        public GameObject getItem;
        public GameObject unGetItem;
        public void SetItem(int isSuccess, List<SimpleItem> list)
        {
            bool isGetted = isSuccess == 1;
            getItem.SetActive(isGetted);
            unGetItem.SetActive(!isGetted);
            if (isGetted)
            {
                foreach(var item in list)
                {
                    if(item.id == Dict.Config.TableConst.contribution)
                        contribution.text = item.num + "";
                    else if (item.id == "item_089")
                        horner.text = item.num + "";
                }
            }
        }
    }

}
